"""
猜数字：1-100
"""

# 方法一：
# import random
# computer_number= random.randint(1,100)
# #print(computer_number)
# my_number=int(input("请输入数字"))
# # print(my_number)
#
# while computer_number != my_number:
#     if my_number > computer_number:
#         print("大了")
#         my_number =int(input("请输入数字"))
#     elif my_number<computer_number:
#         print("小了")
#         my_number =int(input("请输入数字"))
#
# print("猜对了")


# 方法二：
import random
computer_number= random.randint(1,100)
print(computer_number)
my_number =int(input("请输入数字"))
while True:
    if my_number > computer_number:
        print("大了")
        my_number =int(input("请输入数字"))
    elif my_number<computer_number:
        print("小了")
        my_number =int(input("请输入数字"))
    elif my_number==computer_number:
        print("猜对了")
        break








